﻿#ifndef HRIBBONELEMENTMANAGER_H
#define HRIBBONELEMENTMANAGER_H
#include "HRibbonElementCreateDelegate.h"
#include "HRibbonGlobal.h"

///
/// \brief 此类是一个全局单例，用于管理HRibbonElementCreateDelegate
///
class HRIBBON_EXPORT HRibbonElementManager
{
protected:
    HRibbonElementManager();
public:
    virtual ~HRibbonElementManager();
    static HRibbonElementManager *instance();
    HRibbonElementCreateDelegate *delegate();
    void setupDelegate(HRibbonElementCreateDelegate *delegate);

private:
    HRibbonElementCreateDelegate *m_delegate;
};
#ifndef RibbonSubElementMgr
#define RibbonSubElementMgr		HRibbonElementManager::instance()
#endif
#ifndef RibbonSubElementDelegate
#define RibbonSubElementDelegate	HRibbonElementManager::instance()->delegate()
#endif
#ifndef RibbonSubElementStyleOpt
#define RibbonSubElementStyleOpt	HRibbonElementManager::instance()->delegate()->getRibbonStyleOption()
#endif
#endif // HRIBBONELEMENTMANAGER_H
